import { Map } from "immutable";
import { CHANGE_FANS_LIST, CHANGE_CIRCUS_LIST } from "./constant";

const defaultState = Map({
  circusList: [],
  fansList: [],
});

function reducer(state = defaultState, { type, data }) {
  switch (type) {
    case CHANGE_FANS_LIST:
      return state.set("fansList", data);
    case CHANGE_CIRCUS_LIST:
      return state.set("circusList", data);
    default:
      return state;
  }
}

export default reducer;
